﻿@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewBag.Title = "sql查询";
}
@model System.Data.DataTable
<link href="../../Scripts/colorbox/colorbox.css" rel="stylesheet" type="text/css" />
<script src="../../Scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="../../Scripts/colorbox/jquery.colorbox-min.js" type="text/javascript"></script>
<script src="../../Scripts/AdminCommon.js" type="text/javascript"></script>
<div class="right_box_card">
    <ul>
        <li class="right_box_card1"><a href="#">sql查询</a></li>
    </ul>
</div>
<div>
    @using (Html.BeginForm())
    {
        <table class="right_box_tab" style="margin-top: 10px;" width="100%" border="0" cellspacing="0"
            cellpadding="0">
            <tr>
                <td colspan="2">
                    @Html.TextArea("sql", ViewData["Sql"].ToString(), new { @style = "width:400px; height:300px;" })
                </td>
            </tr>
            <tr height="40">
                <td class="entry_tab_td1">
                </td>
                <td>
                    <input type="submit" value="查询" style="width: 100px; height: 30px;" />
                </td>
            </tr>
        </table>
    }
    @if (Model != null && Model.Rows.Count != 0)
    {
        <table class="right_box_tab" style="margin-top: 10px;" width="100%" border="0" cellpadding="0"
            cellspacing="0">
            <tr height="40" class="tab_title">
                @for (int i = 0; i < Model.Columns.Count; i++)
                {
                    <td>
                        @Model.Columns[i].ColumnName
                    </td>
                }
            </tr>
            @for (int i = 0; i < Model.Rows.Count; i++)
            {
                <tr height="35" class="tab_td1">
                    @for (int j = 0; j < Model.Columns.Count; j++)
                    {
                        <td>
                            @Model.Rows[i][j]
                        </td>
                    }
                </tr>
            }
        </table>
    }
</div>
